
#include "RegEx.h"
#include "RegExPure.h"
namespace Canvas
{
	namespace RegEx
	{
		RegExString::RegExString(int _start)
			: start(_start), length(0)
		{

		}
		RegExString::RegExString(const WString & _string, int _start, int _length)
			: value(_length == 0?L"": _string.Sub(_start, _length)), start(_start), length(_length)
		{
		}
		
		int RegExString::Length() const
		{
			return length;
		}

		int RegExString::Start() const
		{
			return start;
		}

		const WString& RegExString::Value() const
		{
			return value;
		}

		bool RegExString::operator==(const RegExString& string) const
		{
			return value == string.value && length == string.length && start == string.start;
		}
		RegExMatch::RegExMatch(const WString & _string, RegExInternal::PureResult * _result)
			: success(true), result(_string, _result->start, _result->length)
		{
		}
		RegExMatch::RegExMatch(const WString & _string, RegExInternal::RichResult * _result, RegExInternal::RichInterpretor * interpreter)
		{
		}
		RegExMatch::RegExMatch(const RegExString & result)
		{
		}
		bool RegExMatch::Success() const
		{
			return success;
		}
		const RegExString & RegExMatch::Result() const
		{
			return result;
		}
		const RegExMatch::CaptureList & RegExMatch::Captures() const
		{
			return captures;
		}
		const RegExMatch::CaptureGroup & RegExMatch::Groups() const
		{
			return groups;
		}
	}
}